﻿Namespace Buchungen

    <DebuggerDisplay("KUeLib.Buchung - {Buchungstext} - {Betrag}")> _
    Public Class Buchung

        Private _id As Integer
        Private _buchungDatum As Date
        Private _wertstellungDatum As Date
        Private _betrag As Double
        Private _kontostand As Double
        Private _beguenstigter As String
        Private _bemerkung As String
        Private _konto As String
        Private _buchungstext As String
        Private _verwendungszweck(14) As String
        Private _status As String
        Private _kategorieId As Integer
        Private _vertragId As Integer
        Private _importfile As String

        Public Sub New()
            _buchungDatum = Date.Now
            _wertstellungDatum = Date.Now
            _status = "erfasst"
        End Sub

        Public Property ImportFile As String
            Get
                Return _importfile
            End Get
            Set(ByVal value As String)
                _importfile = value
            End Set
        End Property

        Public Property Id As Integer
            Get
                Return _id
            End Get
            Set(ByVal value As Integer)
                _id = value
            End Set
        End Property

        Public Property Buchungsdatum As Date
            Get
                Return _buchungDatum
            End Get
            Set(ByVal value As Date)
                If value = Date.MinValue OrElse value = Nothing Then _
                    value = Date.Now.Date
                _buchungDatum = value
            End Set
        End Property

        Public Property Wertstellungsdatum As Date
            Get
                Return _wertstellungDatum
            End Get
            Set(ByVal value As Date)
                If value = Date.MinValue OrElse value = Nothing Then _
                    value = Date.Now.Date
                _wertstellungDatum = value
            End Set
        End Property

        Public Property Betrag As Double
            Get
                Return _betrag
            End Get
            Set(ByVal value As Double)
                _betrag = value
            End Set
        End Property

        Public Property Kontostand As Double
            Get
                Return _kontostand
            End Get
            Set(ByVal value As Double)
                _kontostand = value
            End Set
        End Property

        Public Property Beguenstigter As String
            Get
                Return _beguenstigter
            End Get
            Set(ByVal value As String)
                _beguenstigter = value
            End Set
        End Property

        Public Property Bemerkung As String
            Get
                Return _bemerkung
            End Get
            Set(ByVal value As String)
                _bemerkung = value
            End Set
        End Property

        Public Property Konto As String
            Get
                Return _konto
            End Get
            Set(ByVal value As String)
                _konto = value
            End Set
        End Property

        Public Property Buchungstext As String
            Get
                Return _buchungstext
            End Get
            Set(ByVal value As String)
                _buchungstext = value
            End Set
        End Property

        Public Property Verwendungszweck As String()
            Get
                Return _verwendungszweck
            End Get
            Set(ByVal value As String())
                _verwendungszweck = value
            End Set
        End Property

        Public Property Verwendungszweck1 As String
            Get
                Return _verwendungszweck(1)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(1) = value
            End Set
        End Property

        Public Property Verwendungszweck2 As String
            Get
                Return _verwendungszweck(2)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(2) = value
            End Set
        End Property

        Public Property Verwendungszweck3 As String
            Get
                Return _verwendungszweck(3)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(3) = value
            End Set
        End Property

        Public Property Verwendungszweck0 As String
            Get
                Return _verwendungszweck(0)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(0) = value
            End Set
        End Property

        Public Property Verwendungszweck4 As String
            Get
                Return _verwendungszweck(4)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(4) = value
            End Set
        End Property

        Public Property Verwendungszweck5 As String
            Get
                Return _verwendungszweck(5)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(5) = value
            End Set
        End Property

        Public Property Verwendungszweck6 As String
            Get
                Return _verwendungszweck(6)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(6) = value
            End Set
        End Property

        Public Property Verwendungszweck7 As String
            Get
                Return _verwendungszweck(7)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(7) = value
            End Set
        End Property

        Public Property Verwendungszweck8 As String
            Get
                Return _verwendungszweck(8)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(8) = value
            End Set
        End Property

        Public Property Verwendungszweck9 As String
            Get
                Return _verwendungszweck(9)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(9) = value
            End Set
        End Property

        Public Property Verwendungszweck10 As String
            Get
                Return _verwendungszweck(10)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(10) = value
            End Set
        End Property

        Public Property Verwendungszweck11 As String
            Get
                Return _verwendungszweck(11)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(11) = value
            End Set
        End Property

        Public Property Verwendungszweck12 As String
            Get
                Return _verwendungszweck(12)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(12) = value
            End Set
        End Property

        Public Property Verwendungszweck13 As String
            Get
                Return _verwendungszweck(13)
            End Get
            Set(ByVal value As String)
                _verwendungszweck(13) = value
            End Set
        End Property

        Public Property Status As String
            Get
                Return _status
            End Get
            Set(ByVal value As String)
                _status = value
            End Set
        End Property

        Public Property KategorieId As Integer
            Get
                Return _kategorieId
            End Get
            Set(ByVal value As Integer)
                _kategorieId = value
            End Set
        End Property

        Public Property VertragId As Integer
            Get
                Return _vertragId
            End Get
            Set(ByVal value As Integer)
                _vertragId = value
            End Set
        End Property

    End Class

End Namespace